package com.neu.service.klz;

import com.neu.dao.klz.GoodDaoImpl;

import java.util.List;
import java.util.Map;

public class GoodDaoService {
    private GoodDaoImpl goodDao;
    public GoodDaoService(){
        goodDao=new GoodDaoImpl();
    }
    public List<Map<String,Object>> dofindByGood(){
        List<Map<String,Object>> list=null;
        try {
            list=goodDao.findByGood();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }
    public boolean doupsave(String g_name,String g_now,String g_id,String g_num){
        boolean flag=false;
        try {
            int row=goodDao.upsave(g_name,g_now,g_num,g_id);
            if (row>0){
                flag=true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;

    }
    public boolean dodesave(String g_id){
        boolean flag=false;
        try {
            int row=goodDao.deletesave(g_id);
            if (row>0){
                flag=true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
    }
}
